<template>
    <div>   
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in newsList" :key="item.id">
                <router-link :to="'/home/wenzhang/wenzhanginfo/'+item.id" class="">
                    <img class="mui-media-object mui-pull-left" :src="item.img_url">
                    <div class="mui-media-body">
                        {{item.title}}
                        <p class="mui-ellipsis">
                           <span> 时间:{{item.add_time | dataFormat()}} </span>
                           <span> 点击数:{{item.click}}</span>
                        </p>
                    </div>
                </router-link>
            </li>
		</ul>
    </div>
</template>
<script>
export default {
    data(){
        return {
            newsList:[]
        }
    },
    created(){
        this.getNewsList();
    },
    methods:{
        getNewsList(){
            // 请求数据
            this.$http.get('api/getnewslist').then(response =>{
                if(response.body.status ===0){
                    // 成功
                    // console.log(response.body.message);
                    this.newsList = response.body.message;
                }else{
                    // 失败
                }
            })
        }
    },

    
}
</script>
<style lang="scss" scoped>
    .mui-table-view{
        li{
            height: 80px;
        }
    }
    div{
        margin-top: 16px;
    }
</style>

